/*
 * Libcvs.h
 *
 *  Created on: 08/11/2013
 *      Author: asc
 */

#ifndef LIBCVS_H_
#define LIBCVS_H_

#include "RepoTemplate/RepoTemplate.h"
#include "utils/utils.h"
#include <string>
#include <map>
#include <libxml++/libxml++.h>
#include <iostream>
#include <exception>
#include <locale>

/*Grammar WAY*/
#include "Libcvs.hh"
#include <fstream>

using namespace std;

namespace Libcvs
{

	enum keys_cvs{changelog=1, entry, isoDate, author, commondir, file, name, cvsstate, revision, tag, msg, date, weekday, time, tagisodate, tagdatetag, tagdate};
	map<string,keys_cvs> resolv_key_cvs =
	{
			{"changelog"	,changelog},
			{"entry"		,entry},
			{"isoDate"		,isoDate},
			{"author"		,author},
			{"commondir"	,commondir},
			{"file"			,file},
			{"name"			,name},
			{"cvsstate"		,cvsstate},
			{"revision"		,revision},
			{"tag"			,tag},
			{"commondir"	,commondir},
			{"msg"			,msg},
			{"date"			,date},
			{"weekday"		,weekday},
			{"time"			,time},
			{"tagisodate"	,tagisodate},
			{"tagdatetag"	,tagdatetag},
			{"tagdate"		,tagdate}
	};

	/*
	 *
	 */
	class Libcvs: public RepoTemplate
	{
		public:
			Libcvs();
			Libcvs(string fileName);
			~Libcvs();
			void read();
		private:
			void parse();
			void parseSubTree(xmlpp::TextReader &reader);
			void parseGrammar();

	};

} /* namespace libcvs */
#endif /* LIBCVS_H_ */
